package com.neusoft.recommend.service.impl;

import java.util.Collections;
import java.util.List;

import com.neusoft.recommend.domain.CourseRecommendFull;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.neusoft.recommend.mapper.CourseRecommendMapper;
import com.neusoft.recommend.domain.CourseRecommend;
import com.neusoft.recommend.service.ICourseRecommendService;

/**
 * 课程推荐Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-02-28
 */
@Service
public class CourseRecommendServiceImpl implements ICourseRecommendService 
{
    @Autowired
    private CourseRecommendMapper courseRecommendMapper;

    /**
     * 查询课程推荐
     * 
     * @param uuid 课程推荐主键
     * @return 课程推荐
     */
    @Override
    public CourseRecommend selectCourseRecommendByUuid(Long uuid)
    {
        return courseRecommendMapper.selectCourseRecommendByUuid(uuid);
    }

    /**
     * 查询课程推荐列表
     * 
     * @param courseRecommend 课程推荐
     * @return 课程推荐
     */
    @Override
    public List<CourseRecommend> selectCourseRecommendList(CourseRecommend courseRecommend)
    {
        return courseRecommendMapper.selectCourseRecommendList(courseRecommend);
    }

    @Override
    public List<CourseRecommendFull> selectFullCourseRecommendList(CourseRecommend courseRecommend) {
        return courseRecommendMapper.selectCourseRecommendFullList(courseRecommend);
    }

    /**
     * 新增课程推荐
     * 
     * @param courseRecommend 课程推荐
     * @return 结果
     */
    @Override
    public int insertCourseRecommend(CourseRecommend courseRecommend)
    {
        courseRecommend.setCreateTime(DateUtils.getNowDate());
        return courseRecommendMapper.insertCourseRecommend(courseRecommend);
    }

    /**
     * 修改课程推荐
     * 
     * @param courseRecommend 课程推荐
     * @return 结果
     */
    @Override
    public int updateCourseRecommend(CourseRecommend courseRecommend)
    {
        courseRecommend.setUpdateTime(DateUtils.getNowDate());
        return courseRecommendMapper.updateCourseRecommend(courseRecommend);
    }

    /**
     * 批量删除课程推荐
     * 
     * @param uuids 需要删除的课程推荐主键
     * @return 结果
     */
    @Override
    public int deleteCourseRecommendByUuids(Long[] uuids)
    {
        return courseRecommendMapper.deleteCourseRecommendByUuids(uuids);
    }

    /**
     * 删除课程推荐信息
     * 
     * @param uuid 课程推荐主键
     * @return 结果
     */
    @Override
    public int deleteCourseRecommendByUuid(Long uuid)
    {
        return courseRecommendMapper.deleteCourseRecommendByUuid(uuid);
    }
}
